home *** CD-ROM | disk | FTP | other *** search
/ Delphi Developer's Kit 1996 / Delphi Developer's Kit 1996.iso / power / source21 / bookc.pas < prev    next >
Pascal/Delphi Source File  |  1995-12-22  |  2KB  |  106 lines

  1. unit Bookc;
  2.  
  3. interface
  4.  
  5. uses
  6.   SysUtils, WinTypes, WinProcs, Messages, Classes, Graphics, Controls,
  7.   Forms, Dialogs, StdCtrls, Buttons, ExtCtrls;
  8.  
  9. type
  10.     BookRec=Record
  11.        FilN:String[12];
  12.     end;
  13.   TForm3 = class(TForm)
  14.     ScrollBox1: TScrollBox;
  15.     Image1: TImage;
  16.     Label1: TLabel;
  17.     BitBtn1: TBitBtn;
  18.     BitBtn2: TBitBtn;
  19.     Label2: TLabel;
  20.     Image2: TImage;
  21.     Image3: TImage;
  22.     ScrollBox2: TScrollBox;
  23.     Image4: TImage;
  24.     procedure Image3Click(Sender: TObject);
  25.     procedure FormCreate(Sender: TObject);
  26.     procedure Image2Click(Sender: TObject);
  27.   private
  28.     { Private declarations }
  29.   public
  30.     { Public declarations }
  31.  
  32.   end;
  33.  
  34. var
  35.   Form3: TForm3;
  36.   SearchRec:TSearchRec;
  37.   BR:BookRec;
  38.   BookF:File of BookRec;
  39.   Check:Integer;
  40.   trans:integer;
  41.   dire:String;
  42.  
  43. implementation
  44.  
  45. {$R *.DFM}
  46.  
  47. procedure TForm3.Image3Click(Sender: TObject);
  48. var
  49.    ST:String;
  50. begin
  51.      If (trans>=0) and (trans<FileSize(bookF)) then
  52.      begin
  53.           trans:=trans+1;
  54.           If trans<>fileSize(booKF) then
  55.                st:=dire+'\PEN2\P'+IntToStr(trans+1)+'.bmp';
  56.           Form3.image4.picture.loadfromfile(ST);
  57.           seek(BookF,trans);
  58.           Read(BookF,BR);
  59.           Form3.image1.picture.loadfromfile(dire+'\pen\'+BR.FilN);
  60.           Form3.label2.caption:=Br.FilN;
  61.      End;
  62. end;
  63.  
  64. procedure TForm3.FormCreate(Sender: TObject);
  65. var
  66.    st:String;
  67.    f2:TextFile;
  68. begin
  69.      AssignFile(f2,'c:\c1.c');
  70.      reset(f2);
  71.      readln(f2,dire);
  72.      closefile(f2);
  73.      AssignFile(BookF,dire+'\bookfile.ps');
  74.      {$i-}
  75.      Reset(BookF);
  76.      {$I+}
  77.      If FileSize(BookF)>0 then
  78.         begin
  79.              st:=dire+'\PEN2\P'+IntToStr(1)+'.bmp';
  80.              Form3.image4.picture.loadfromfile(ST);
  81.              seek(BookF,0);
  82.              Read(BookF,BR);
  83.              Form3.Image1.picture.loadfromFile(dire+'\pen\'+BR.FilN);
  84.              Form3.label2.caption:=Br.FilN;
  85.              trans:=0;
  86.         End;
  87. end;
  88. procedure TForm3.Image2Click(Sender: TObject);
  89. VAR
  90.    ST:STRING;
  91. begin
  92.      If (trans>0) and (Trans<=FileSize(bookF)) then
  93.      begin
  94.           trans:=trans-1;
  95.           st:=dire+'\PEN2\P'+IntToStr(TRAnS+1)+'.bmp';
  96.           Form3.image4.picture.loadfromfile(ST);
  97.           seek(BookF,trans);
  98.           Read(BookF,BR);
  99.           Form3.image1.picture.loadfromfile(dire+'\pen\'+BR.FilN);
  100.           Form3.label2.caption:=Br.FilN;
  101.      End;
  102.  
  103. end;
  104.  
  105. end.
  106.